package com.appspot.zarm.gomoku;

import java.util.Random;

import com.appspot.zarm.gomoku.transfer.CoordImpl;

public class Robot {
	
	public Coord doTurn(GomokuBoard board) {
		
		CoordImpl position = null;
		while (board.isHasEmptyCells()) {
			Random random = new Random();
			int x = random.nextInt(GomokuBoardFactory.BOARD_SIZE);
			int y = random.nextInt(GomokuBoardFactory.BOARD_SIZE);
			position = new CoordImpl(x, y); 
			if (board.getCell(position).getCellState().equals(CellState.EMPTY)) {
				break;
			}
		}
		
		return position;
	}

}
